package module.service.impl;

import common.bean.SearchParameter;
import module.dao.SysTreeDao;
import module.model.SysTreeModel;
import module.service.SysTreeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class SysTreeServiceImpl implements SysTreeService {
    @Autowired
    private SysTreeDao sysTreeDao;

    @Transactional
    public List<SysTreeModel> findByPrentId(Long parentId) {
        SearchParameter searchParameter = new SearchParameter();
        searchParameter.addParam("parentId",parentId);
        return getSysTreeModelListBySearchParameter(searchParameter);
    }

    public List<SysTreeModel> getSysTreeModelListBySearchParameter(SearchParameter searchParameter) {
        return sysTreeDao.getSysTreeModelListBySearchParameter(searchParameter);
    }
}
